package cn.dzz.springcloud.service;

import cn.dzz.springcloud.component.JsonResult;
import cn.dzz.springcloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author DaiZhiZhou
 * @file SpringCloud-ATGG-2020
 * @create 2020-08-26 23:43
 */
@Component
@FeignClient(value = "PROVIDER-PAYMENT-SERVICE") // 我要调用的服务名是？
public interface FeignPaymentService {

    // 将8001服务的接口注册到OpenFeign中 但是注解在类上的@RequestMapping是不是无法获取到？
    // 所以这里需要手写接口信息
    @GetMapping("payment/get/{id}")
    JsonResult<Payment> getPaymentById(@PathVariable("id") Long id);
}
